package modle;

/**
 * MembershipId entity. @author MyEclipse Persistence Tools
 */

public class MembershipId implements java.io.Serializable {

	// Fields

	private Member member;
	private Club club;

	// Constructors

	/** default constructor */
	public MembershipId() {
	}

	/** full constructor */
	public MembershipId(Member member, Club club) {
		this.member = member;
		this.club = club;
	}

	// Property accessors

	public Member getMember() {
		return this.member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	public Club getClub() {
		return this.club;
	}

	public void setClub(Club club) {
		this.club = club;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof MembershipId))
			return false;
		MembershipId castOther = (MembershipId) other;

		return ((this.getMember() == castOther.getMember()) || (this
				.getMember() != null
				&& castOther.getMember() != null && this.getMember().equals(
				castOther.getMember())))
				&& ((this.getClub() == castOther.getClub()) || (this.getClub() != null
						&& castOther.getClub() != null && this.getClub()
						.equals(castOther.getClub())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getMember() == null ? 0 : this.getMember().hashCode());
		result = 37 * result
				+ (getClub() == null ? 0 : this.getClub().hashCode());
		return result;
	}

}